package com.mao.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.apache.struts2.json.annotations.JSON;

import com.mao.model.store.Store;

@MappedSuperclass
public class BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

	public String status = STATUS_NORMAL;

	public static final String STATUS_NORMAL = "0";
	public static final String STATUS_DELETED = "1";

	public Store store;

	@ManyToOne(optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "STOREID", nullable = false, columnDefinition = "int")
	@JSON(serialize = false)
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "STATUS")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
}
